package com.rayboot.footpoint.utils;

import java.util.Calendar;

import android.util.Log;

public class FootLog {

	public final static boolean DEBUG = true;
	public final static String TAG = "FootLog";
    private static final String FORMAT_METHOD_NAME = "  %s:%s:%d";

    private static StackTraceElement getCurrentStackTraceElement() {
        return Thread.currentThread().getStackTrace()[4];
    } 
 
    private static String getMethodName(StackTraceElement trace) {
        return String.format(FORMAT_METHOD_NAME, trace.getFileName(),trace.getMethodName(),
                trace.getLineNumber());
    }
    
	public static void i(String msg) {

		final Calendar c = Calendar.getInstance();
		if (DEBUG) {
			Log.i(TAG, c.get(Calendar.HOUR) + ":" + c.get(Calendar.MINUTE) + ":" +c.get(Calendar.SECOND) + ":" +c.get(Calendar.MILLISECOND) + getMethodName(getCurrentStackTraceElement()) + ">>>>" + msg);
		}
	}
}
